package com.project.bean;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.io.Serializable;
import java.util.List;


/**
 * (Order实体类)
 */
@TableName("t_order")
public class OrderBean implements Serializable {
    /**订单*/
    @TableId(value = "pk_orderId",type = IdType.AUTO)
    private Integer id;
    /**收货人*/
    @TableField("o_accept")
    private String accept;
    /**送货地址*/
    @TableField("o_address")
    private String address;
    /**收货人电话*/
    @TableField("o_phone")
    private String phone;
    /**下单时间*/
    @TableField("o_date")
    private LocalDate orderDate = LocalDate.now();
    /**订单总价*/
    @TableField("o_totalPrice")
    private Integer totalPrice;
    /**订单状态*/
    @TableField("o_status")
    private String status = "未发货";
    /**订单明细*/
    @TableField(exist = false)
    private List<OrderInfoBean> detailList;
    /**下单用户*/
    @TableField("fk_userId")
    private Integer userId;

    public OrderBean() {
    }

    public OrderBean(String accept, String address, String phone, Integer totalPrice) {
        this.accept = accept;
        this.address = address;
        this.phone = phone;
        this.totalPrice = totalPrice;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAccept() {
        return accept;
    }

    public void setAccept(String accept) {
        this.accept = accept;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public LocalDate getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(LocalDate orderDate) {
        this.orderDate = orderDate;
    }

    public Integer getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Integer totalPrice) {
        this.totalPrice = totalPrice;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public List<OrderInfoBean> getDetailList() {
        return detailList;
    }

    public void setDetailList(List<OrderInfoBean> detailList) {
        this.detailList = detailList;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "OrderBean{" +
                "id=" + id +
                ", accept='" + accept + '\'' +
                ", address='" + address + '\'' +
                ", phone='" + phone + '\'' +
                ", orderDate=" + orderDate +
                ", totalPrice=" + totalPrice +
                ", status='" + status + '\'' +
                ", detailList=" + detailList +
                ", userId=" + userId +
                "}\n";
    }
}
